/*
 * Copyright (c) 2007-2021 西安交通信息投资营运有限公司 版权所有
 */

package com.xci.xajtfb.om.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelIgnore;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.github.lvyanyang.core.BaseEntity;
import com.github.lvyanyang.core.Const;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;

import java.util.Date;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * 客户档案
 * @author 吕艳阳 lvyanyang@xci96716.com
 * @since 2021-02-04 19:05:25
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(description = "客户档案")
public class BasicCustomer extends BaseEntity {
    /**
     * 客户主键
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @ExcelIgnore
    @Excel(name = "客户主键")
    @ApiModelProperty(value = "客户主键", position = 1)
    private Long id;

    /**
     * 客户姓名
     */
    @NotBlank(message = "客户名称不能为空")
    @Length(max = 200, message = "客户名称不能超过{max}个字符")
    @Excel(name = "客户名称", width = 40d)
    @ApiModelProperty(value = "客户名称", required = true)
    private String name;

    /**
     * 客户简称
     */
    @NotBlank(message = "客户简称不能为空")
    @Length(max = 200, message = "客户简称不能超过{max}个字符")
    @Excel(name = "客户简称", width = 20d)
    @ApiModelProperty(value = "客户简称", required = true)
    private String shortName;

    /**
     * 客户简拼
     */
    @Length(max = 200, message = "客户简拼不能超过{max}个字符")
    @ExcelIgnore
    @ApiModelProperty(value = "客户简拼")
    private String spell;

    /**
     * 客户全拼
     */
    @Length(max = 400, message = "客户全拼不能超过{max}个字符")
    @ExcelIgnore
    @ApiModelProperty(value = "客户全拼")
    private String fullSpell;

    /**
     * 经营性质
     */
    @NotBlank(message = "经营性质不能为空")
    @Length(max = 200, message = "经营性质不能超过{max}个字符")
    @Excel(name = "经营性质", width = 15d)
    @ApiModelProperty(value = "经营性质", required = true)
    private String nature;

    /**
     * 客户类型
     */
    @NotBlank(message = "客户类型不能为空")
    @Length(max = 200, message = "客户类型不能超过{max}个字符")
    @Excel(name = "客户类型")
    @ApiModelProperty(value = "客户类型", required = true)
    private String category;

    /**
     * 主营业务
     */
    @Length(max = 50, message = "主营业务不能超过{max}个字符")
    @Excel(name = "主营业务")
    @ApiModelProperty(value = "主营业务", required = true)
    private String business;

    /**
     * 联系人
     */
    @Length(max = 200, message = "联系人不能超过{max}个字符")
    @Excel(name = "联系人")
    @ApiModelProperty(value = "联系人")
    private String linkMan;

    /**
     * 联系电话
     */
    @Length(max = 200, message = "联系电话不能超过{max}个字符")
    @Excel(name = "联系电话", width = 20d)
    @ApiModelProperty(value = "联系电话")
    private String linkPhone;

    /**
     * 税号
     */
    @Length(max = 200, message = "税号不能超过{max}个字符")
    @Excel(name = "税号", width = 20d)
    @ApiModelProperty(value = "税号")
    private String taxNumber;

    /**
     * 单位地址
     */
    @Length(max = 200, message = "单位地址不能超过{max}个字符")
    @Excel(name = "单位地址", width = 40d)
    @ApiModelProperty(value = "单位地址")
    private String taxAddress;

    /**
     * 单位电话
     */
    @Length(max = 200, message = "单位电话不能超过{max}个字符")
    @Excel(name = "单位电话", width = 20d)
    @ApiModelProperty(value = "单位电话")
    private String taxTel;

    /**
     * 开户银行
     */
    @Length(max = 200, message = "开户银行不能超过{max}个字符")
    @Excel(name = "开户银行", width = 40d)
    @ApiModelProperty(value = "开户银行")
    private String taxBank;

    /**
     * 银行账户
     */
    @Length(max = 200, message = "银行账户不能超过{max}个字符")
    @Excel(name = "银行账户", width = 20d)
    @ApiModelProperty(value = "银行账户")
    private String taxBankAccount;

    /**
     * 余额欠费额度
     */
    @Excel(name = "余额欠费额度", width = 20d)
    @ApiModelProperty(value = "余额欠费额度")
    private Double stockOweTheAmount;

    /**
     * 开发票欠费额度
     */
    @Excel(name = "开发票欠费额度", width = 20d)
    @ApiModelProperty(value = "开发票欠费额度")
    private Double invoiceOweTheAmount;

    /**
     * 操作人
     */
    @Length(max = 30, message = "操作人姓名不能超过{max}个字符")
    @Excel(name = "操作人")
    @ApiModelProperty(value = "操作人姓名", position = 97)
    private String operateUserName;

    /**
     * 操作时间
     */
    @NotNull(message = "操作时间不能为空")
    @Excel(name = "操作时间", width = 20d, exportFormat = Const.DEFAULT_DATETIME_PATTERN)
    @ApiModelProperty(value = "操作时间", position = 98)
    private Date operateDateTime;

    /**
     * 状态(true:禁用;false:启用)
     */
    @NotNull(message = "状态不能为空")
    @Excel(name = "状态", replace = {"启用_true", "禁用_false"})
    @ApiModelProperty(value = "状态(true:启用 false:禁用)", required = true, position = 99)
    private Boolean status;

    /**
     * 备注
     */
    @Length(max = 200, message = "备注不能超过{max}个字符")
    @Excel(name = "备注", width = 20d)
    @ApiModelProperty(value = "备注", position = 100)
    private String remark;

    /**
     * 合同编号
     */
    @Length(max = 500, message = "合同编号长度不能超过{max}")
    @Excel(name = "合同编号", width = 20d)
    @ApiModelProperty(value = "合同编号", position = 24)
    private String contractNumber;

    /**
     * 开发票类型
     */
    @Length(max = 500, message = "开发票类型长度不能超过{max}")
    @Excel(name = "开发票类型", width = 20d)
    @ApiModelProperty(value = "开发票类型", position = 25)
    private String invoicingCategory;

    /**
     * 客户经理
     */
    @Length(max = 500, message = "客户经理长度不能超过{max}")
    @Excel(name = "客户经理", width = 20d)
    @ApiModelProperty(value = "客户经理", position = 26)
    private String customerManager;

    /**
     * 可分配余额
     */
    @ExcelIgnore
    @ApiModelProperty(value = "可分配余额")
    private Double feeTotal;

    /**
     * 服务费可开票余额
     */
    @ExcelIgnore
    @ApiModelProperty(value = "服务费可开票余额")
    private Double invoiceServiceTotal;

    /**
     * 设备费可开票余额
     */
    @ExcelIgnore
    @ApiModelProperty(value = "设备费可开票余额")
    private Double invoiceDeviceTotal;

    /**
     * 是否自维护
     */
    @NotNull(message = "是否自维护不能为空")
    @Excel(name = "是否自维护", replace = {"是_true", "否_false"})
    @ApiModelProperty(value = "是否自维护", required = true)
    private Boolean maintainSelf;

    /**
     * 自维护开始时间
     */
    @Excel(name = "自维护开始时间", width = 20d, exportFormat = Const.DEFAULT_DATETIME_PATTERN)
    @ApiModelProperty(value = "自维护开始时间")
    private Date maintainSelfStartTime;

    /**
     * 维护机构名称
     */
    @Excel(name = "维护机构名称", width = 20d)
    @ApiModelProperty(value = "维护机构名称")
    private String maintainName;

    /**
     * 维护机构联系人
     */
    @Excel(name = "维护机构联系人")
    @ApiModelProperty(value = "维护机构联系人")
    private String maintainLinkMan;

    /**
     * 维护机构联系电话
     */
    @Excel(name = "维护机构联系电话")
    @ApiModelProperty(value = "维护机构联系电话")
    private String maintainLinkPhone;

    /**
     * 客户快照主键
     */
    @Length(max = 30, message = "主键不能超过{max}个字符")
    @ExcelIgnore
    @ApiModelProperty(value = "客户快照主键", required = true)
    private String snapshotId;

    /**
     * 项目主键
     */
    @NotNull(message = "项目主键不能为空")
    @Length(max = 30, message = "项目主键不能超过{max}个字符")
    @ExcelIgnore
    @ApiModelProperty(value = "项目主键", required = true)
    private String projectId;

    /**
     * 项目名称
     */
    @NotBlank(message = "项目名称不能为空")
    @Length(max = 200, message = "项目名称不能超过{max}个字符")
    @Excel(name = "项目名称", width = 20d)
    @ApiModelProperty(value = "项目名称")
    private String projectName;

    /**
     * 附件数量
     */
    @Excel(name = "附件数量", width = 20d)
    @ApiModelProperty(value = "附件数量")
    private Integer fileCount;
}